<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>flex布局</title>
    <style>
        div{
            /* 默认是不换行 装不下会改变子元素的宽度 */
            flex-wrap: wrap;/* 换行 */
            display: flex;
            /* 默认的排列方式是x轴从左到右
            flex-direction: row; */ 

            /* flex-direction: row-reverse;
            从右到左排列 */

            /* flex-direction: column;
            沿着y轴从上到下排列 */

            /* flex-direction: column-reverse;
            y轴从下到上排列*/
            width: 800px; 
            height: 300px;
            background-color: skyblue;

            /* 主轴上居中对齐
            justify-content: center; */
            /* 从尾部开始排列
            justify-content: end; */
            /* 平分剩余空间
            justify-content: space-around;
             */
             /* 先两边贴边 在平分剩余空间 */
            justify-content: space-between;

            /*  设置侧轴的排列方式*/
            /* 垂直居中 */
            align-items: center;
            /* 从上到下 */
            /* align-items: flex-start; */
            /* 从下到上 */
            /* align-items: flex-end; */
        }
        span{
            width: 150px;
            height: 100px;
            background-color: pink;
        }
    </style>
</head>
<body>
    <div>
        <span>1</span>
        <span>2</span>
        <span>3</span>
    </div>
</body>
</html>